import type { columnsInterface } from "@/interface/table"
import { thousandth } from "@/utils"
import { SEQ } from "@/constant"
import { useSelectAsync } from "@/hook/index"
/**
 * 字典逻辑
 */
import { useEnum } from "@/enum"
export function useColumns() {
  // hook
  const { getEnumList } = useEnum()
  const { useGetCountryOptions, useGetCreatedByOptions, useGetInterviewOptions } = useSelectAsync()
  const columns: columnsInterface[] = [
    {
      id: 1,
      title: "序号",
      type: SEQ,
      width: 60,
      field: "id",
      fixed: "left",
    },
    {
      id: 2,
      title: "姓名",
      field: "name",
      width: 200,
      type: "slot",
      slotName: "name",
      className: "color-primary",
      search: "input",
    },
    {
      id: 3,
      title: "金额",
      field: "nationalityId",
      width: 120,
      align: "right",
      type: "price",
      search: "input",
    },
    {
      id: 4,
      title: "头像",
      field: "a0002",
      type: "slot",
      slotName: "face",
      width: 120,
    },
    {
      id: 5,
      title: "性别",
      field: "sex_dictText",
      width: 80,
      type: "slot",
      slotName: "tag",
      filters: getEnumList("supportingLecturesModule"),
      search: "select",
    },
    {
      id: 6,
      title: "国籍",
      field: "nationalityId_dictText",
      width: 120,
      search: "selectAsync",
      selectAsync: {
        label: "name",
        value: "code",
        requestOptions: useGetCountryOptions,
      },
    },
    {
      id: 7,
      title: "编号",
      field: "professorCode",
      width: 120,
      search: "input",
    },
    {
      id: 8,
      title: "联系电话",
      field: "mobile",
      width: 120,
      search: "input",
    },
    {
      id: 9,
      title: "联系邮箱/运营端账号",
      field: "email",
      width: 200,
      search: "input",
    },
    {
      id: 10,
      title: "微信",
      field: "a0008",
      width: 100,
      search: "input",
    },
    {
      id: 11,
      title: "就读院校",
      field: "a0009",
      width: 120,
      search: "input",
    },
    {
      id: 12,
      title: "就读专业",
      field: "a00010",
      width: 120,
      search: "input",
    },
    {
      id: 13,
      title: "学历",
      field: "a00011",
      width: 120,
      search: "input",
    },
    {
      id: 14,
      title: "困难模式",
      field: "a00012",
      width: 120,
      search: "input",
    },
    {
      id: 15,
      title: "简历是否上传",
      field: "a00013",
      width: 130,
      search: "input",
    },
    {
      id: 16,
      title: "综合评分",
      field: "a00014",
      width: 120,
      search: "input",
    },
    {
      id: 17,
      title: "录取官",
      field: "a00015",
      width: 120,
      search: "selectAsync",
      selectAsync: {
        label: "name",
        value: "code",
        requestOptions: useGetInterviewOptions,
        mode: "multiple",
      },
    },
    {
      id: 18,
      title: "合作阶段",
      field: "a00016",
      width: 120,
      search: "input",
    },
    {
      id: 19,
      title: "创建时间",
      field: "a00017",
      width: 120,
      search: "date",
    },
    {
      id: 20,
      title: "创建人",
      field: "a00018",
      width: 120,
      search: "selectAsync",
      selectAsync: {
        label: "userName",
        value: "id",
        requestOptions: useGetCreatedByOptions,
      },
    },
  ]

  return {
    columns,
  }
}
